// comm/views/hdModalView/hdModalView.js
import S_request from '../../utils/requestService.js';
import CONFIG from '../../config.js';
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    modalObj: {
      type: Object,
      value: null
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    modalObj: {}
  },
  ready: function() {
    let modalObj = this.data.modalObj;
    if (modalObj.isShow) {
      modalObj.bg = '../image/gy_bg.png'
    } else {
      modalObj.bg = '../image/gy_bg1.png'
      if (modalObj.id == '3288') { //中奖
        modalObj.name = '开始抽奖'
        modalObj.detail = '参与抽奖'
        modalObj.icon = '../image/chaopin_icon.png'
        modalObj.show_1 = true
        modalObj.show_2 = false
      } else if (modalObj.id == '3306') { //未中奖
        modalObj.name = '幸运红包'
        modalObj.detail = '进入红包'
        modalObj.icon = '../image/redpack_icon.png'
        modalObj.show_1 = false
        modalObj.show_2 = true
      }
    }
    this.setData({
      modalObj: modalObj
    })
    console.log("aaaa===" + JSON.stringify(this.data.modalObj))
  },


  /**
   * 组件的方法列表
   */
  methods: {
    returnEevet: function(e) {},
    confirmAc1:function(e) {
      let param = 'formId=0' + "&eventid=10"
      S_request.index.tongJiNum('3288', param, (result) => {
        console.log("data====" + result);
      })
      this.triggerEvent('confirmAc')
    },
    confirmAc2: function (e) {
      let param = 'formId=0' + "&eventid=10"
      S_request.index.tongJiNum('3306', param, (result) => {
        console.log("data====" + result);
      })
      this.triggerEvent('confirmAc')
    },
    confirmAc: function(e) {
      this.triggerEvent('confirmAc')
    }
  }
})